import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
import guardSetup from "./guards";

const routes: RouteRecordRaw[] = [];

Object.values(
    import.meta.glob('./routes/*.ts', { eager: true, import: 'default' })
).forEach((route) => {
    routes.push(...(route as RouteRecordRaw[]))
})

const router = createRouter({
    routes,
    history: createWebHashHistory(),
})

guardSetup(router);

export default router;